package org.jeecg.modules.wms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.wms.entity.FinishedGoodsOutboundDetail;
import org.jeecg.modules.wms.mapper.FinishedGoodsOutboundDetailMapper;
import org.jeecg.modules.wms.service.IFinishedGoodsOutboundDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 成品出库单明细Service实现类
 */
@Service
public class FinishedGoodsOutboundDetailServiceImpl extends ServiceImpl<FinishedGoodsOutboundDetailMapper, FinishedGoodsOutboundDetail> 
        implements IFinishedGoodsOutboundDetailService {

    @Autowired
    private FinishedGoodsOutboundDetailMapper detailMapper;

    @Override
    public List<FinishedGoodsOutboundDetail> queryByOutboundId(String outboundId) {
        return detailMapper.selectByOutboundId(outboundId);
    }

    @Override
    public List<FinishedGoodsOutboundDetail> queryByOrderId(String orderId) {
        return detailMapper.selectByOrderId(orderId);
    }

    @Override
    public List<FinishedGoodsOutboundDetail> queryByInventoryId(String inventoryId) {
        return detailMapper.selectByInventoryId(inventoryId);
    }

    @Override
    public Integer sumOutboundQuantityByOutboundId(String outboundId) {
        return detailMapper.sumOutboundQuantityByOutboundId(outboundId);
    }

    @Override
    public boolean deleteBatchByOutboundId(String outboundId) {
        return detailMapper.deleteBatchByOutboundId(outboundId) > 0;
    }
}
